package Exercises;

import java.util.Scanner;

public class Task8_1 {

	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
		
		System.out.println(" Please add M and N: ");
		
			int m = sc.nextInt();
			int n = sc.nextInt();
		System.out.println("Please enter how long is the line: ");	
			int l = sc.nextInt();			
			
			int a = 0;
			int c = 0;
			
			for (int i = 0; i <= l; i +=m){
			
				if (i==a)
				{  
					a +=n;
					c++;
				
			}
			}
			System.out.println("The lines have " +  c + " holes on the same position");

			
			
		
		
		
		
	}

}
